<!DOCTYPE html>
<html lang="en">

<head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <title>学生端</title>
     <link rel="stylesheet" href="./css/app.css" />
     <link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" />
     <script src="js/template.js"></script>
     <script src="./js/jquery-1.12.4.min.js"></script>
     <script src="./js/jquery.form.js"></script>
     <script src="./js/jquery.mobile-1.4.5.min.js"></script>
     <script>
          var STUID="2014020300001";
     </script>
</head>

<body>
     <!----------------------------首页登陆页面--------------------------------------->
     <div data-role="page" id="index" data-theme="s">
          <script>
               /*学生登入验证*/
               function stu_enter() {
                    var id = $("#stu_name").val();
                    var passw = $("#stu_password").val();
                    $.post("http://123.206.198.158:9093/student_enter", {
                         id: id
                         , passw: passw
                    }, function (data, status) {
                         if (data == "true") {
                              STUID = id;
                              //alert(STUID);
                              window.location.href = "#msg-message?id=" + id;
                         }
                         else {
                              alert("账号或密码错误");
                         }
                    }, "text");
               }
               /*教师登入验证*/
               function tea_enter() {
                    var id = $("#stu_name").val();
                    var passw = $("#stu_password").val();
                    $.post("http://123.206.198.158:9093/teacher_enter", {
                         id: id
                         , passw: passw
                    }, function (data, status) {
                         if (data == "true") {
                              window.location.href = "teacher.html?id=" + id;
                         }
                         else {
                              alert("账号或密码错误");
                         }
                    }, "text");
               }
               /*社团登入验证*/
               function ass_enter() {
                    var id = $("#stu_name").val();
                    var passw = $("#stu_password").val();
                    $.post("http://123.206.198.158:9093/team_enter", {
                         id: id
                         , passw: passw
                    }, function (data, status) {
                         if (data == "true") {
                              window.location.href = "association.html?id=" + id;
                         }
                         else {
                              alert("账号或密码错误");
                         }
                    }, "text");
               }
          </script>
          <div data-role="header" data-tap-toggle="false"> </div>
          <div data-role="content" data-theme="k">
               <div class="onload-header-div img-center"> <img src="./img/flower2.png" alt="登录头像" class="onload-header-img img-center-img"> </div>
               <div class="onload-button-div">
                    <form method="post">
                         <fieldset data-role="collapsible" data-collapsed-icon="user" data-expanded-icon="eye" data-iconpos="bottom">
                              <h3>请登录</h3>
                              <label for="name"></label>
                              <input type="text" name="user" id="stu_name" placeholder="请输入您的学号、工号或社团号">
                              <label for="password"></label>
                              <input type="password" name="pass" id="stu_password" placeholder="请输入您的密码">
                              <input type="button" onclick="stu_enter()" data-inline="false" value="学生登陆">
                              <input type="button" onclick="tea_enter()" data-inline="false" value="教师登陆">
                              <input type="button" onclick="ass_enter()" data-inline="false" value="社团登陆"> </fieldset>
                    </form>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true"> </div>
     </div>
     <!--                       学生端-信息箱页面
                                学生端-信息箱页面
                                学生端-信息箱页面
        11111111111111111111111111111111111111001111111111111111111111111
        11111111111111111111111111111111111100011111111111111111111111111
        11111111111111111111111111111111100001111111111111111111111111111
        11111111111111111111111111111110000111111111111111111111111111111
        11111111111111111111111111111000000111111111111111111111111111111
        11111111111111111111111111100000011110001100000000000000011111111
        11111111111111111100000000000000000000000000000000011111111111111
        11111111111111110111000000000000000000000000000011111111111111111
        11111111111111111111111000000000000000000000000000000000111111111
        11111111111111111110000000000000000000000000000000111111111111111
        11111111111111111100011100000000000000000000000000000111111111111
        11111111111111100000110000000000011000000000000000000011111111111
        11111111111111000000000000000100111100000000000001100000111111111
        11111111110000000000000000001110111110000000000000111000011111111
        11111111000000000000000000011111111100000000000000011110001111111
        11111110000000011111111111111111111100000000000000001111100111111
        11111111000001111111111111111111110000000000000000001111111111111
        11111111110111111111111111111100000000000000000000000111111111111
        11111111111111110000000000000000000000000000000000000111111111111
        11111111111111111100000000000000000000000000001100000111111111111
        11111111111111000000000000000000000000000000111100000111111111111
        11111111111000000000000000000000000000000001111110000111111111111
        11111111100000000000000000000000000000001111111110000111111111111
        11111110000000000000000000000000000000111111111110000111111111111
        11111100000000000000000001110000001111111111111110001111111111111
        11111000000000000000011111111111111111111111111110011111111111111
        11110000000000000001111111111111111100111111111111111111111111111
        11100000000000000011111111111111111111100001111111111111111111111
        11100000000001000111111111111111111111111000001111111111111111111
        11000000000001100111111111111111111111111110000000111111111111111
        11000000000000111011111111111100011111000011100000001111111111111
        11000000000000011111111111111111000111110000000000000011111111111
        11000000000000000011111111111111000000000000000000000000111111111
        11001000000000000000001111111110000000000000000000000000001111111
        11100110000000000001111111110000000000000000111000000000000111111
        11110110000000000000000000000000000000000111111111110000000011111
        11111110000000000000000000000000000000001111111111111100000001111
        11111110000010000000000000000001100000000111011111111110000001111
        11111111000111110000000000000111110000000000111111111110110000111
        11111110001111111100010000000001111100000111111111111111110000111
        11111110001111111111111110000000111111100000000111111111111000111
        11111111001111111111111111111000000111111111111111111111111100011
        11111111101111111111111111111110000111111111111111111111111001111
        11111111111111111111111111111110001111111111111111111111100111111
        11111111111111111111111111111111001111111111111111111111001111111
        11111111111111111111111111111111100111111111111111111111111111111
        11111111111111111111111111111111110111111111111111111111111111111
                                                          -->
     <!--------------------------------------------------------信息箱页面，课程页面------------------------------------------------------->
     <div data-role="page" id="msg-message" data-theme="s">
          <script>
               $(document).on("pagecreate", "#msg-message", function () {
                    $(document).on("swiperight", "#msg-message", function (e) {
                         // We check if there is no open panel on the page because otherwise
                         // a swipe to close the left panel would also open the right panel (and v.v.).
                         // We do this by checking the data that the framework stores on the page element (panel: open).
                         if ($(".ui-page-active").jqmData("panel") !== "open") {
                              if (e.type === "swiperight") {
                                   $("#person").panel("open");
                              }
                         }
                    });
               });
               var go_index = function () {
                    window.self.location = "#index";
               }
          </script>
          <script>
               function resetNickname(newStuNickname) {
                    $.ajax({
                         url: "http://123.206.198.158:9093/modify_nickname"
                         , data: {
                              id: STUID
                              , nickname: newStuNickname
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , success: function (data) {
                              receive_student_course = data;
                              alert("修改成功！");
                              window.location.reload();
                         }
                    });
               }
          </script>
          <script>
               $("#msg-message").on("pagebeforecreate", function (e) {
                    //STUID = window.location.href.slice(-13);
                    var my_circle_icon;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_stuimage"
                         , data: {
                              id: STUID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "text"
                         , success: function (data) {
                              my_circle_icon = data;
                         }
                    });
                    $("#circle_icon").attr("src", my_circle_icon);
                    var receive_student_course;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_CD"
                         , data: {
                              id: STUID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_student_course = data;
                         }
                    });
                    var course_data = {
                         list: receive_student_course
                    };
                    $("#student_course_ul").append(template("student_index", course_data));
               });
          </script>
          <!----------------------------------------------------------------------->
          <script id="student_index" type="text/html"> {{each list as value i}}
               <li id={{value.id}}>
                    <a id={{value.id}} onclick="window.location.href= '#msg-message-course?id={{value.id}}';return false" data-transition="slidedown"> <img class="msg-li-header" src={{value.icon}} alt="" />
                         <h1 class="msg-li-name">{{value.nname}}</h1> </a>
               </li> {{/each}} </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l">
                              <a href="#person" data-role="button" class="nav_header_a" onclick="showPrivate()"><img id="circle_icon" alt="个人中心" class="nav_header_img"></a>
                         </li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal"> <a href="#" data-role="button" data-theme="j" class="ui-btn-active ui-state-persist">消息</a> <a href="./message.html#msg-teacher" data-role="button" data-transition="slide" data-theme="j">老师</a> </li>
                         <li class="msg-top-nav-head-right"></li>
                    </ul>
               </div>
          </div>
          <!-------------------------------------------------个人中心（首）------------------------------------------------------------->
          <div data-role="panel" id="person" data-theme="k" data-display="overlay">
               <script>
                    function go_index() {
                         window.location.href = "index.html";
                    }

                    function showPrivate() {
                         var myIcon;
                         $.ajax({
                              url: "http://123.206.198.158:9093/get_stuimage"
                              , data: {
                                   id: STUID
                              }
                              , cache: true
                              , async: false
                              , type: "POST"
                              , dataType: "text"
                              , success: function (data) {
                                   myIcon = data;
                              }
                         });
                         var myNick;
                         $.ajax({
                              url: "http://123.206.198.158:9093/get_nickName"
                              , data: {
                                   id: STUID
                              }
                              , cache: true
                              , async: false
                              , type: "POST"
                              , dataType: "text"
                              , success: function (data) {
                                   myNick = data;
                              }
                         });
                         $("#myImg").attr("src", myIcon);
                         $("#myNick").attr("value", myNick);
                    }
               </script>
               <script>
                    function ajaxStuIconUP() {
                         $("#def_two").attr("value", STUID);
                         var options = {
                              success: function (data) {
                                   alert("修改成功！");
                                   window.location.reload();
                              }
                         };
                         $("#changeIcon").ajaxSubmit(options);
                    }
               </script>
               <div class="choice_list">
                    <ul data-role="listview" data-inset="true">
                         <div class="img-center"> <img id="myImg" alt="头像" class="img-center-img">
                              <input type="text" id="myNick" value="" contenteditable="false" readonly="readonly" /> </div>
                         <li>
                              <div data-role="collapsible" data-inset="false" data-iconpos="none" data-mini="true">
                                   <h3>修改头像</h3>
                                   <form id="changeIcon" action="http://123.206.198.158:8080/webb/File/StuUp" enctype="multipart/form-data" method="post">
                                        <input type="hidden" name="stu_id" value="" id="def_two" />
                                        <input type="file" data-mini="true" name="newStuIcon_input">
                                        <input type="button" data-mini="true" value="保存" onclick="ajaxStuIconUP()"> </form>
                              </div>
                         </li>
                         <li>
                              <div data-role="collapsible" data-inset="false" data-iconpos="none" data-mini="true">
                                   <h3>修改昵称</h3>
                                   <input id="newStuNickname_input" type="text" placeholder="请输入新昵称" />
                                   <button data-mini="true" onclick="resetNickname($(newStuNickname_input).val())">保存</button>
                              </div>
                         </li>
                         <li>
                              <div data-role="collapsible" data-inset="false" data-iconpos="none" data-mini="true">
                                   <h3>关于APP</h3>
                                   <textarea readonly="readonly">一款极其方便的校园助手APP</textarea>
                              </div>
                         </li>
                         <li>
                              <div data-role="collapsible" data-inset="false" data-iconpos="none" data-mini="true">
                                   <h1>退出登录</h1>
                                   <button onclick="go_index()" data-mini="true">确认</button>
                              </div>
                         </li>
                    </ul>
               </div>
          </div>
          <!-----------------------------------------------个人中心（尾）------------------------------------------------------------->
          <div data-role="content">
               <div class="choice_list">
                    <ul id="student_course_ul" data-role="listview" data-inset="true" data-icon="false" data-filter="true" data-filter-placeholder="搜索课程"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-message" data-icon="green-message1" class="ui-btn-active ui-state-persist">信息箱</a></li>
                         <li><a href="#post" data-icon="green-post2" data-transition="none">海报栏</a></li>
                         <li><a href="#lost-list" data-icon="green-lost2" data-transition="none">失物墙</a></li>
                         <li><a href="#course" data-icon="green-course2" data-transition="none">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!------------------------------------------------------------信息箱课程消息页面-------------------------------------------------------------->
     <div data-role="page" id="msg-message-course" data-theme="s">
          <!--课程消息模板-->
          <script id="studentIndex_groupTemplate" type="text/html"> {{each list as value i}}
               <li>
                    <a href="#"> <img src={{value.icon}}>
                         <p>{{value.date2}}</p>
                         <textarea readonly="readonly">{{value.chat}}</textarea>
                    </a>
               </li> {{/each}} </script>
          <!--课程消息渲染-->
          <script>
               $("#msg-message-course").on("pagebeforeshow", function (e) {
                    var msg_id = location.hash.slice(23);
                    var msg_name;
                    document.getElementById("show_courseGroup_Chat").innerHTML = "";
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_courseName"
                         , data: {
                              id: msg_id
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "text"
                         , success: function (data) {
                              msg_name = data;
                         }
                    });
					if (msg_id==100){
					msg_name="网球社";
					}
                    document.getElementById("groupName").innerHTML = msg_name;
                    var receive_StudentGroup_chat;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_groupSinMessage"
                         , data: {
                              id: msg_id
                              , stu_id: STUID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_StudentGroup_chat = data;
                              //alert(data);
                         }
                    });
                    var stuGroup_chat_data = {
                         list: receive_StudentGroup_chat
                    };
                    $("#show_courseGroup_Chat").append(template("studentIndex_groupTemplate", stuGroup_chat_data)).listview('refresh');
               });
          </script>
          <script>
               function back_to_msg_course() {
                    $.mobile.changePage("index.html#msg-message");
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar" id="msg-course-msg-navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"> <a href="#" data-rel="back" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext ui-btn-corner-all">返回</a> </li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="l"> <a id="groupName">NULL</a> </li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul data-role="listview" id="show_courseGroup_Chat" data-inset="true" data-icon="false" data-theme="s" data-mini="true" class="msg-course-ul"></ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="s">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal">
                              <!--<a href="#" data-rel="back" data-theme="s" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext ui-btn-corner-all">返回</a>--></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal">
                              <!--<span class="msg-msg-name">JAVA编程基础</span>--></li>
                         <li></li>
                    </ul>
               </div>
          </div>
     </div>
     <!--------------------------------------------------------------信息箱教师信息页面--------------------------------------------------------------->
     <div data-role="page" id="msg-teacher" data-theme="s">
          <script>
               $("#msg-teacher").on("pagebeforecreate", function (e) {
                    //alert("aaaaa");
                    var receive_teacher_message;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_teacher"
                         , data: {
                              stu_id: STUID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_teacher_message = data;
                              //alert(data[0].email);
                         }
                    });
                    var teacher_message_data = {
                         list: receive_teacher_message
                    };
                    $("#show_teacher_message_ul").append(template("student_index_teaMessage", teacher_message_data));
               });
          </script>
          <script id="student_index_teaMessage" type="text/html"> {{each list as value i}}
               <li>
                    <a href="#"> <img src={{value.icon}} class="msg-teacher-header" />
                         <div data-role="collapsible" data-mini="true" data-inset="true" data-iconpos="none">
                              <h3>{{value.nname}}</h3> <span class="lost-content-time">邮箱</span>
                              <input type="text" id="msg-teacher-mail" value={{value.email}} contenteditable="false" readonly="readonly"> <span class="lost-content-time">联系电话</span>
                              <input type="text" id="msg-teacher-phone" value={{value.tel}} contenteditable="false" readonly="readonly"> <span class="lost-content-time">办公室地址</span>
                              <input type="text" id="msg-teacher-mail" value={{value.address}} contenteditable="false" readonly="readonly">
                              <input type="button" value="课件屋" id="msg-teacher-file" onclick="window.location.href='#course-files?{{value.id}}';return false" contenteditable="false" data-mini="true" data-theme="l"> </div>
                    </a>
               </li> {{/each}} </script>
          <script>
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#msg-message" data-role="button" data-transition="slide" data-direction="reverse">消息</a> <a href="#" data-role="button" class="ui-btn-active ui-state-persist">老师</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul id="show_teacher_message_ul" data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="搜索" data-icon="false"></ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-message" data-role="button" data-icon="green-message1" class="ui-btn-active ui-state-persist">信息箱</a></li>
                         <li><a href="#post" data-icon="green-post2" data-transition="none">海报栏</a></li>
                         <li><a href="#lost-list" data-icon="green-lost2" data-transition="none">失物墙</a></li>
                         <li><a href="#course" data-icon="green-course2" data-transition="none">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!------------------------------------------课件下载页面------------------------------------------------->
     <div data-role="page" id="course-files" data-theme="s">
          <!--加载课件-->
          <script>
               $("#course-files").on("pagebeforecreate", function (e) {
                    var down_id = location.hash.slice(location.hash.indexOf("?") + 1);
                    //alert(down_id);
                    var down_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_files"
                         , data: {
                              tea_id: down_id
                              , stu_id: STUID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              down_data = data;
                         }
                    });
                    var downs_data = {
                         list: down_data
                    };
                    $("#show_down").append(template("down_template", downs_data));
               });
          </script>
          <!--课件展示模板-->
          <script id="down_template" type="text/html"> {{each list as value i}}			
					<li>
                    <h class="lost-content-time">{{value.nname}}-----上传时间：{{value.date}}</h>
                    <p>{{value.remark}}</p>
                    <input type="button" onclick="window.location.href='http://123.206.198.158:8080/webb/File/FileDownload?fID={{value.id}}';return false('')" value="下载" data-mini="true" data-inline="true">
               </li>
					{{/each}} </script>
          <script>
               function delFile(self) {
                    $.ajax({
                         url: "http://123.206.198.158:9093/del_a_file"
                         , data: {
                              f_id: self.id
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , success: function (data) {}
                    });
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#msg-teacher" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext ui-corner-all">个人</a></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="l"><a>课件屋</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal" data-theme="l"></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul id="show_down" data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="搜索课件" data-mini="true"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-class" data-icon="green-message2" data-transition="slide" data-direction="reverse">信息箱</a></li>
                         <li><a href="#post-official" data-icon="green-post2" data-transition="slide" data-direction="reverse">海报栏</a></li>
                         <li><a href="#" data-icon="green-lost1" data-transition="slide" data-direction="reverse" class="ui-btn-active ui-state-persist">课件空间</a></li>
                         <li><a href="#course" data-icon="green-course2">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!--
                                 学生端-海报栏海报
                                 学生端-海报栏海报
                                 学生端-海报栏海报
             quu..__
         $$$b  `---.__
          "$$b        `--.                          ___.---uuudP
           `$$b           `.__.------.__     __.---'      $$$$"              .
             "$b          -'            `-.-'            $$$"              .'|
               ".                                       d$"             _.'  |
                 `.   /                              ..."             .'     |
                   `./                           ..::-'            _.'       |
                    /                         .:::-'            .-'         .'
                   :                          ::''\          _.'            |
                  .' .-.             .-.           `.      .'               |
                  : /'$$|           .@"$\           `.   .'              _.-'
                 .'|$u$$|          |$$,$$|           |  <            _.-'
                 | `:$$:'          :$$$$$:           `.  `.       .-'
                 :                  `"--'             |    `-.     \
                :##.       ==             .###.       `.      `.    `\
                |##:                      :###:        |        >     >
                |#'     `..'`..'          `###'        x:      /     /
                 \                                   xXX|     /    ./
                  \                                xXXX'|    /   ./
                  /`-.                                  `.  /   /
                 :    `-  ...........,                   | /  .'
                 |         ``:::::::'       .            |<    `.
                 |             ```          |           x| \ `.:``.
                 |                         .'    /'   xXX|  `:`M`M':.
                 |    |                    ;    /:' xXXX'|  -'MMMMM:'
                 `.  .'                   :    /:'       |-'MMMM.-'
                  |  |                   .'   /'        .'MMM.-'
                  `'`'                   :  ,'          |MMM<
                    |                     `'            |tbap\
                     \                                  :MM.-'
                      \                 |              .''
                       \.               `.            /
                        /     .:::::::.. :           /
                       |     .:::::::::::`.         /
                       |   .:::------------\       /
                      /   .''               >::'  /
                      `',:                 :    .'
                                           `:.:'
        --------------------------------------------------------------------->
     <!----------------------------海报栏海报栏页面---------------------------------->
     <div data-role="page" id="post" data-theme="s">
          <!--学生组织海报栏模板-->
          <script id="student_show_student_post" type="text/html"> {{each list as value i}}
               <li id="student_student_post_list{{i}}">
                    <div class="post-show-div">
                         <div class="post-show-div-inner-left"><img src={{value.icon}} alt=""></div>
                         <div class="post-show-div-inner-right">
                              <a href="#popup-post{{i+1}}" data-rel="popup" data-position-to="window" data-transition="flow"><img src={{value.pic}} alt=""></a>
                         </div>
                         <div data-role="popup" id="popup-post{{i+1}}" data-overlay-theme="s" data-corners="false"><a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-s ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img src={{value.pic}} alt=""></div>
                    </div>
               </li> {{/each}} </script>
          <!--学生组织海报栏渲染-->
          <script>
               $("#post").on("pagebeforecreate", function (e) {
                    var receive_post_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_studentnews"
                         , data: {}
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_post_data = data;
                         }
                    });
                    var post_data = {
                         list: receive_post_data
                    };
                    $("#post_student_student_ul").append(template("student_show_student_post", post_data));
               });
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"> </li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#" class="ui-btn-active ui-state-persist">社团</a><a href="#post-official" data-transition="slide">校方</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul data-role="listview" data-inset="true" id="post_student_student_ul"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-message" data-icon="green-message2" data-transition="none">信息箱</a></li>
                         <li><a href="#" data-icon="green-post1" class="ui-btn-active ui-state-persist">海报栏</a></li>
                         <li><a href="#lost-list" data-icon="green-lost2" data-transition="none">失物墙</a></li>
                         <li><a href="#course" data-icon="green-course2" data-transition="none">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!----------------------------校方活动海报栏------------------------------------>
     <div data-role="page" id="post-official" data-theme="s">
          <!--校方海报栏模板-->
          <script id="student_show_school_post" type="text/html"> {{each list as value i}}
               <li id="student_school_post_list{{i}}">
                    <div class="post-show-div">
                         <div class="post-show-div-inner-left"><img src="{{value.icon}}" alt=""></div>
                         <div class="post-show-div-inner-right">
                              <a href="#popup_school_post{{i+1}}" data-rel="popup" data-position-to="window" data-transition="flow"><img src={{value.pic}} alt=""></a>
                         </div>
                         <div data-role="popup" id="popup_school_post{{i+1}}" data-overlay-theme="s" data-corners="false"><a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-s ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img src={{value.pic}} alt=""></div>
                    </div>
               </li> {{/each}} </script>
          <!--海报栏渲染-->
          <script>
               $("#post-official").on("pagebeforecreate", function (e) {
                    var receive_post_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_schoolnews"
                         , data: {}
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_post_data = data;
                         }
                    });
                    var post_data = {
                         list: receive_post_data
                    };
                    $("#post_student_school_ul").append(template("student_show_school_post", post_data));
               });
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"> </li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#post" data-transition="slide" data-direction="reverse">社团</a><a href="#" class="ui-btn-active ui-state-persist">校方</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul data-role="listview" data-inset="true" id="post_student_school_ul">
                         <!--<li>
                              <div class="post-show-div">
                                   <div class="post-show-div-inner-left"><img src="./img/stuunion.jpg" alt=""></div>
                                   <div class="post-show-div-inner-right"><img src="./img/post1.jpg" alt=""></div>
                              </div>
                         </li>-->
                    </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-message" data-icon="green-message2" data-transition="none">信息箱</a></li>
                         <li><a href="#" data-icon="green-post1" class="ui-btn-active ui-state-persist">海报栏</a></li>
                         <li><a href="#lost-list" data-icon="green-lost2" data-transition="none">失物墙</a></li>
                         <li><a href="#course" data-icon="green-course2" data-transition="none">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!--                      学生端-失物墙
                               学生端-失物墙
                               学生端-失物墙
                 ___====-_  _-====___
           _--^^^#####//      \\#####^^^--_
        _-^##########// (    ) \\##########^-_
       -############//  |\^^/|  \\############-
     _/############//   (@::@)   \\############\_
    /#############((     \\//     ))#############\
   -###############\\    (oo)    //###############-
  -#################\\  / VV \  //#################-
 -###################\\/      \//###################-
_#/|##########/\######(   /\   )######/\##########|\#_
|/ |#/\#/\#/\/  \#/\##\  |  |  /##/\#/  \/\#/\#/\#| \|
`  |/  V  V  `   V  \#\| |  | |/#/  V   '  V  V  \|  '
   `   `  `      `   / | |  | | \   '      '  '   '
                    (  | |  | |  )
                   __\ | |  | | /__
                  (vvv(VVV)(VVV)vvv)
        ------------------------------------------------>
     <!----------------------------------------失物墙页面 寻物---------------------------------------------------------------->
     <div data-role="page" id="lost-list" data-theme="s">
          <!----------------------------------------寻物页面渲染模板--------------------------------------------------------------->
          <script id="show_lost_find_all" type="text/html"> {{each list as value i}}
               <li id="{{value.id}}">
                    <div class="lost-content-div">
                         <div><img src={{value.icon}} alt="头像" class="lost-content-img-header" />
                              <h3>
						<span class="lost-content-user">{{value.nickname}}</span>
						<span class="lost-content-time">{{value.date2}}</span>
						<span class="lost-content-num">{{value.tel}}</span>
						<span class="lost-content-phone">联系:</span>
					</h3> </div>
                         <textarea readonly="readonly" cols="30" rows="4" class="lost-content-text">{{value.detail}}</textarea> <img src="{{value.pic}}" alt="u盘" class="lost-content-img" />
                         <div id="{{value.id}}_Com_div" data-role="collapsible" data-collapsed-icon="arrow-d" data-expanded-icon="none" data-iconpos="top" data-content-theme="s" data-mini="true">
                              <h3 onclick="autoComment(this)"></h3></div>
                    </div>
               </li> {{/each}} </script>
          <!--------------------------------------------------加载寻物帖子--------------------------------------------------->
          <script>
               $("#lost-list").on("pagebeforecreate", function (e) {
                    var list_content_data; //接受帖子内容的变量 //用于记录帖子的id
                    //var receive_comment_data; //接收评论内容的变量
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_lostfound"
                         , data: {
                              ttype: "lost"
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "json"
                         , success: function (data) {
                              list_content_data = data;
                         }
                    });
                    var list_content = {
                         list: list_content_data
                    };
                    $("#lost_list_content").append(template('show_lost_find_all', list_content));
               });
          </script>
          <!-----------------------加载评论-------------------寻物寻主两用---------------------------------------------------->
          <script>
               function autoComment(self) {
                    var foundCom_liID = self.parentNode.parentNode.parentNode.id;
                    var foundCom_divID = "#" + foundCom_liID + "_Com_div";
                    var foundCom_divID2 = foundCom_liID + "_Com_div";
                    document.getElementById(foundCom_divID2).innerHTML = "";
                    document.getElementById(foundCom_divID2).innerHTML = "<h3 onclick=autoComment(this)></h3>";
                    var receive_found_comment;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_comment"
                         , data: {
                              id: foundCom_liID
                         }
                         , cache: true
                         , async: false
                         , type: "post"
                         , dataType: "json"
                         , success: function (data) {
                              receive_found_comment = data;
                         }
                    });
                    var list_find_content22 = {
                         list: receive_found_comment
                    };
                    $(foundCom_divID).append(template('paintView', list_find_content22));
               }
          </script>
          <!--------------------------------------------------评论渲染模板---------------------------------------------------->
          <script id="paintView" type="text/html">
               <div class="lost-content-comment-mydiv">{{each list as value i}}
                    <div data-role="fieldcontain" class="lost-content-comment-div"> <span class="lost-content-comment-name">{{value.nickname}}</span><span class="lost-content-comment-time">{{value.date}}</span>
                         <textarea cols="20" rows="3" name="textarea" id="lost-content-comment-text" class="lost-content-comment-text" readonly="readonly">{{value.chat}}</textarea>
                    </div> {{/each}}
                    <div class="lost-content-comment-mydiv">
                         <input type="text" placeholder="我来帮忙..." id="lost-content-comment-mine-text" class="lost-content-comment-mytext" />
                         <input type="button" value="评论" data-mini="true" data-theme="k" onclick="send_chat(this)" class="lost-content-comment-mybutton" /> </div>
               </div>
          </script>
          <script>
               function send_chat(self) {
                    /* alert(self.parentNode.parentNode.parentNode.parentNode.parentNode.id);*/
                    var chat_val = $("#lost-content-comment-mine-text").val();
                    if (chat_val == "" || chat_val == null) {
                         alert("评论不能为空哦！");
                    }
                    else {
                         $.ajax({
                              url: "http://123.206.198.158:9093/add_comment"
                              , data: {
                                   id: self.parentNode.parentNode.parentNode.parentNode.parentNode.id
                                   , stu_id: STUID
                                   , chat: $("#lost-content-comment-mine-text").val()
                              }
                              , cache: true
                              , async: false
                              , type: "post"
                              , success: function (data, a) {
                                   /* autoComment(self);*/
                                   if (data) {
                                        alert("评论成功！");
                                        window.self.location.reload();
                                   }
                              }
                         });
                    }
               }
          </script>
          <!---------------------------------------------------寻物页面静态页面-------------------------------------------------------------->
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="s">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#" data-role="button" class="ui-btn-active ui-state-persist">寻物</a> <a href="./lost.html#find-list" data-role="button" data-transition="slide">寻主</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#lost-mine" class="ui-btn ui-icon-green-tag1 ui-btn-icon-notext ui-corner-all">发布</a></li>
                    </ul>
               </div>
          </div>
          <div data-role="content" data-theme="k">
               <div class="choice_list">
                    <ul data-role="listview" data-filter="true" data-filter-reveal="false" data-filter-placeholder="关键字搜索" data-inset="true" id="lost_list_content"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-message" data-icon="green-message2" data-transition="none">信息箱</a></li>
                         <li><a href="#post" data-icon="green-post2" data-transition="none">海报栏</a></li>
                         <li><a href="#" data-icon="green-lost1" class="ui-btn-active ui-state-persist">失物墙</a></li>
                         <li><a href="#course" data-icon="green-course2" data-transition="none">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!--------------------------------------------失物墙寻主页面------------------------------------------------------>
     <div data-role="page" id="find-list" data-theme="s">
          <!--------------------------------------------寻主页面渲染模板---------------------------------------------------->
          <script id="show_find_lost_all" type="text/html"> {{each list as value i}}
               <li id="{{value.id}}">
                    <div class="lost-content-div">
                         <div> <img src={{value.icon}} alt="头像" class="lost-content-img-header" />
                              <h3>
                        <span class="lost-content-user">{{value.nickname}}</span>
						<!--<span class="lost-content-user">{{value.stu_id}}</span>-->
						<span class="lost-content-time">{{value.date2}}</span>
						<span class="lost-content-num">{{value.tel}}</span>
						<span class="lost-content-phone">联系:</span>
					</h3> </div>
                         <textarea readonly="readonly" cols="40" rows="5" class="lost-content-text">{{value.detail}}</textarea> <img src="{{value.pic}}" alt="u盘" class="lost-content-img" />
                         <div id="{{value.id}}_Com_div" data-role="collapsible" data-collapsed-icon="arrow-d" data-expanded-icon="none" data-iconpos="top" data-content-theme="s" data-mini="true">
                              <h4 onclick="autoComment(this)"></h4> </div>
                    </div>
               </li> {{/each}} </script>
          <!---------------------------------------寻主页面渲染实现------------------------------------------------->
          <script>
               $("#find-list").on("pagebeforecreate", function (e) {
                    var list_find_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_lostfound"
                         , data: {
                              ttype: "found"
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "json"
                         , success: function (data) {
                              list_find_data = data;
                         }
                    });
                    var list_find_content = {
                         list: list_find_data
                    };
                    $("#find_list_content").append(template('show_find_lost_all', list_find_content));
               });
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#lost-list" data-role="button" data-transition="slide" data-direction="reverse">寻物</a> <a href="#" data-role="button" class="ui-btn-active ui-state-persist">寻主</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#lost-mine" class="ui-btn ui-icon-green-tag1 ui-btn-icon-notext ui-corner-all">发布</a></li>
                    </ul>
               </div>
          </div>
          <!----------------------------------------------寻主静态页面-------------------------------------->
          <div data-role="content" data-theme="k">
               <div class="choice_list">
                    <ul data-role="listview" data-inset="true" data-filter="true" data-filter-reveal="false" data-filter-placeholder="关键字搜索" id="find_list_content"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-message" data-icon="green-message2" data-transition="none">信息箱</a></li>
                         <li><a href="#post" data-icon="green-post2" data-transition="none">海报栏</a></li>
                         <li><a href="#lost-list" data-icon="green-lost1" class="ui-btn-active ui-state-persist">失物墙</a></li>
                         <li><a href="#course" data-icon="green-course2" data-transition="none">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!------------------------------失物墙消息详情查看--------------------->
     <div></div>
     <!-----------------------------------------------失物墙消息管理页面------------------------------------------------------->
     <div data-role="page" id="lost-mine" data-theme="s">
          <!-----------------------------------------------失物墙消息管理页面模板--------------------------------------------------->
          <script id="lost_find_manage" type="text/html"> {{each list as value i}}
               <li id="{{value.id}}">
                    <div class="lost-content-div">
                         <div><img src="./img/header-redgirl.png" alt="头像" class="lost-content-img-header">
                              <h3>
						<span class="lost-content-user"></span>
						<span class="lost-content-time">{{value.date1}}</span>
						<span class="lost-content-num">{{value.tel}}</span>
						<span class="lost-content-phone">联系:</span>
					</h3> </div>
                         <textarea readonly="readonly" cols="40" rows="8" class="lost-content-text">{{value.detail}}</textarea> <img src={{value.pic}} alt="失物照片" class="lost-content-img" />
                         <div id="{{value.id}}_Com_div" data-role="collapsible" data-collapsed-icon="arrow-d" data-expanded-icon="none" data-iconpos="top" data-theme="k" data-mini="true">
                              <h3 onclick="autoComment(this)"></h3> </div>
                    </div>
                    <div class="lost-mine-btn-div">
                         <input id="{{value.id}}" type="button" onclick="delete_message(this)" value="删除" data-mini="true" /> </div>
               </li> {{/each}} </script>
          <script>
               function delete_message(self) {
                    $.ajax({
                         url: "http://123.206.198.158:9093/remove_message"
                         , data: {
                              id: self.id
                         }
                         , cache: true
                         , async: false
                         , type: "post"
                         , success: function (data, a) {
                              //refresh();
							  alert("删除成功！");
                              window.self.location.reload();
                         }
                    });
               }
          </script>
          <!--------------------------------------------------失物墙消息管理页面渲染--------------------------------------------------------->
          <script>
               $("#lost-mine").on("pagebeforecreate", function (e) {
                    var receive_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_message_byId"
                         , data: {
                              id: STUID
                         }
                         , cache: true
                         , async: false
                         , type: "post"
                         , dataType: "json"
                         , success: function (data) {
                              receive_data = data;
                         }
                    });
                    var get_data_content = {
                         list: receive_data
                    };
                    $("#lost_find_manage_ul").prepend(template('lost_find_manage', get_data_content));
               });
          </script>
          <!----------------------------------------------------------失物墙管理静态页面---------------------------------------------------------->
          <div data-role="header" data-tap-toggle="false" data-theme="s">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#" data-rel="back" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext">返回</a></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-inline="true"><a data-role="button" data-theme="l">我已发布</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#lost-send" class="ui-btn ui-icon-green-edit1 ui-btn-icon-notext">发布</a></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice-list">
                    <ul data-role="listview" data-inset="true" id="lost_find_manage_ul"> </ul>
               </div>
          </div>
     </div>
     <!-----------------------------------------------------------失物墙消息发布页面------------------------------------------------------------->
     <div data-role="page" id="lost-send" data-theme="k">
          <script>
               var flag = false;

               function add_lostfind_check() {
                    if ($("#msg_user_phone").val() == "" || $("#lost_send_textarea").val() == "") {
                         alert("请您正确填写联系电话！");
                    }
                    else {
                         flag = true;
                    }
                    alert($("#lost_send_pic").val());
               }
          </script>
          <script>
               function ajaxLFIconUP() {
                    $("#def_one").attr("value", STUID);
                    var options = {
                         success: function (data) {
                              alert("发布成功！");
                              window.location.reload();
                         }
                    };
                    $("#submitLF").ajaxSubmit(options);
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"> <a href="#" data-rel="back" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext">返回</a></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="l"><a>新告示</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="text-center">
                    <form id="submitLF" action="http://123.206.198.158:8080/webb/File/LFUp" enctype="multipart/form-data" method="post">
                         <fieldset data-role="fieldcontain" class="lost-send-type">
                              <input type="hidden" name="stu_id" value="" id="def_one" /> <span>告示类型:</span>
                              <select name="ttype" id="send_type" data-mini="true" data-theme="s">
                                   <option value="lost">寻物</option>
                                   <option value="found">寻主</option>
                              </select> <span>联系电话:</span>
                              <input type="text" id="msg_user_phone" name="tel" contenteditable="false"> <span>告示内容:</span>
                              <textarea cols="40" rows="8" name="detail" id="lost_send_textarea"></textarea> <span>照片:</span>
                              <input name="lost_send_pic" id="lost_send_pic" type="file" accept="image/jpg" />
                              <input type="button" value="发布" class="lost-send-submit-btn" data-mini="true" data-inline="true" onclick="ajaxLFIconUP()" /> </fieldset>
                    </form>
               </div>
          </div>
     </div>
     <!--                           学生端-课程表
                                    学生端-课程表
                                    学生端-课程表
                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
            __.'              ~.   .~              `.__
          .'//                  \./                  \\`.
       .'//                     |                     \\`.
     .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
    .'//.-"                 `-.  |  .-'                 "-.\\`.
  .'//______.============-..   \ | /   ..-============.______\\`.
.'______________________________\|/______________________________`.


     -->
     <!------------------------------------------------课程表------------------------------------------------------>
     <div data-role="page" id="course" data-theme="s">
          <script>
               function tableMerge(tableID, position) {
                    poi = "" + position;
                    var firstTd = "";
                    var currentTd = "";
                    var spanNum = 0;
                    $(tableID + " tr td:nth-child(" + poi + ")").slice(0).each(function (i) {
                         var temp = $(this);
                         if (temp.text() != "") {
                              if (i == 0) {
                                   firstTd = $(this);
                                   spanNum = 1;
                              }
                              else {
                                   currentTd = $(this);
                                   if (firstTd.text() == currentTd.text()) {
                                        spanNum++;
                                        currentTd.hide();
                                        firstTd.attr("rowSpan", spanNum);
                                   }
                                   else {
                                        firstTd = $(this);
                                        spanNum = 1;
                                   }
                              }
                         }
                    });
               }
          </script>
          <script>
               var course;
               $('#course').on('pagebeforecreate', function (event) {
                    var URL = "";
                    switch ("student") {
                    case "student":
                         URL = "http://123.206.198.158:9093/get_studentcourse";
                         break;
                    case "teacher":
                         URL = "http://123.206.198.158:9093/get_teachercourse";
                         break;
                    }
                    $.ajax({
                         url: URL
                         , data: {
                              id: STUID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "json"
                         , success: function (data) {
                              course = data;
                         }
                    });
                    if (course[0]["saturday"] == "false") {
                         $("#saturday").hide();
                         for (var j = 61; j <= 611; j++) {
                              var s = "#table" + j;
                              $(s).hide();
                              if ((j + 1) % 10 == 0) {
                                   j *= 10;
                                   j -= 81;
                              }
                         }
                    }
                    if (course[0]["sunday"] == "false") {
                         $("#sunday").hide();
                         for (var j = 71; j <= 711; j++) {
                              var s = "#table" + j;
                              $(s).hide();
                              if ((j + 1) % 10 == 0) {
                                   j *= 10;
                                   j -= 81;
                              }
                         }
                    }
                    if (course[0]["eleven"] == "false") {
                         $("#eleven").hide();
                    }
                    for (var i = 11; i <= 71; i += 10) {
                         for (var j = i; j <= i * 10 + 1; j++) {
                              var s = "#table" + j;
                              if ((course[0][j] + "").slice(0, 2) == "单周") {
                                   $(s).attr("onclick", "living(this)");
                                   var temp = (course[0][j] + "").slice(0, course[0]["9" + j] - 6);
                                   $(s).append(temp);
                                   continue;
                              }
                              $(s).append(course[0][j]);
                              if ((j + 1) % 10 == 0) {
                                   j *= 10;
                                   j -= 81;
                              }
                         }
                    }
                    for (var i = 2; i < 9; i++) {
                         tableMerge("#timetable", i);
                    }
               });
          </script>
          <script>
               function living(self) {
                    var str = document.getElementById(self.id).innerHTML;
                    switch (str.slice(0, 2)) {
                    case "单周":
                         document.getElementById(self.id).innerHTML = (course[0][self.id.slice(5)] + "").slice(course[0]["9" + self.id.slice(5)]);
                         break;
                    case "双周":
                         document.getElementById(self.id).innerHTML = (course[0][self.id.slice(5)] + "").slice(0, course[0]["9" + self.id.slice(5)] - 6);
                         break;
                    }
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="k">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"> </li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="l"><a>课程表</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content" class="choice_list">
               <table id="timetable" class="course-table" cellspacing="0px">
                    <thead>
                         <tr>
                              <th>课程</th>
                              <th>周一</th>
                              <th>周二</th>
                              <th>周三</th>
                              <th>周四</th>
                              <th>周五</th>
                              <th id="saturday">周六</th>
                              <th id="sunday">周日</th>
                         </tr>
                    </thead>
                    <tbody id="stu-course-table">
                         <tr>
                              <td>1</td>
                              <td id="table11" onclick=""></td>
                              <td id="table21" onclick=""></td>
                              <td id="table31" onclick=""></td>
                              <td id="table41" onclick=""></td>
                              <td id="table51" onclick=""></td>
                              <td id="table61" onclick=""></td>
                              <td id="table71" onclick=""></td>
                         </tr>
                         <tr>
                              <td>2</td>
                              <td id="table12" onclick=""></td>
                              <td id="table22" onclick=""></td>
                              <td id="table32" onclick=""></td>
                              <td id="table42" onclick=""></td>
                              <td id="table52" onclick=""></td>
                              <td id="table62" onclick=""></td>
                              <td id="table72" onclick=""></td>
                         </tr>
                         <tr>
                              <td>3</td>
                              <td id="table13" onclick=""></td>
                              <td id="table23" onclick=""></td>
                              <td id="table33" onclick=""></td>
                              <td id="table43" onclick=""></td>
                              <td id="table53" onclick=""></td>
                              <td id="table63" onclick=""></td>
                              <td id="table73" onclick=""></td>
                         </tr>
                         <tr>
                              <td>4</td>
                              <td id="table14" onclick=""></td>
                              <td id="table24" onclick=""></td>
                              <td id="table34" onclick=""></td>
                              <td id="table44" onclick=""></td>
                              <td id="table54" onclick=""></td>
                              <td id="table64" onclick=""></td>
                              <td id="table74" onclick=""></td>
                         </tr>
                         <tr>
                              <td>5</td>
                              <td id="table15" onclick=""></td>
                              <td id="table25" onclick=""></td>
                              <td id="table35" onclick=""></td>
                              <td id="table45" onclick=""></td>
                              <td id="table55" onclick=""></td>
                              <td id="table65" onclick=""></td>
                              <td id="table75" onclick=""></td>
                         </tr>
                         <tr>
                              <td>6</td>
                              <td id="table16" onclick=""></td>
                              <td id="table26" onclick=""></td>
                              <td id="table36" onclick=""></td>
                              <td id="table46" onclick=""></td>
                              <td id="table56" onclick=""></td>
                              <td id="table66" onclick=""></td>
                              <td id="table76" onclick=""></td>
                         </tr>
                         <tr>
                              <td>7</td>
                              <td id="table17" onclick=""></td>
                              <td id="table27" onclick=""></td>
                              <td id="table37" onclick=""></td>
                              <td id="table47" onclick=""></td>
                              <td id="table57" onclick=""></td>
                              <td id="table67" onclick=""></td>
                              <td id="table77" onclick=""></td>
                         </tr>
                         <tr>
                              <td>8</td>
                              <td id="table18" onclick=""></td>
                              <td id="table28" onclick=""></td>
                              <td id="table38" onclick=""></td>
                              <td id="table48" onclick=""></td>
                              <td id="table58" onclick=""></td>
                              <td id="table68" onclick=""></td>
                              <td id="table78" onclick=""></td>
                         </tr>
                         <tr>
                              <td>9</td>
                              <td id="table19" onclick=""></td>
                              <td id="table29" onclick=""></td>
                              <td id="table39" onclick=""></td>
                              <td id="table49" onclick=""></td>
                              <td id="table59" onclick=""></td>
                              <td id="table69" onclick=""></td>
                              <td id="table79" onclick=""></td>
                         </tr>
                         <tr>
                              <td>10</td>
                              <td id="table110" onclick=""></td>
                              <td id="table210" onclick=""></td>
                              <td id="table310" onclick=""></td>
                              <td id="table410" onclick=""></td>
                              <td id="table510" onclick=""></td>
                              <td id="table610" onclick=""></td>
                              <td id="table710" onclick=""></td>
                         </tr>
                         <tr id="eleven">
                              <td>11</td>
                              <td id="table111" onclick=""></td>
                              <td id="table211" onclick=""></td>
                              <td id="table311" onclick=""></td>
                              <td id="table411" onclick=""></td>
                              <td id="table511" onclick=""></td>
                              <td id="table611" onclick=""></td>
                              <td id="table711" onclick=""></td>
                         </tr>
                    </tbody>
                    <tfoot> </tfoot>
               </table>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-message" data-icon="green-post2" data-transition="none">信息箱</a></li>
                         <li><a href="#post" data-icon="green-post2" data-transition="none">海报栏</a></li>
                         <li><a href="#lost-list" data-icon="green-lost2" data-transition="none">失物墙</a></li>
                         <li><a href="#" data-icon="green-course1" class="ui-btn-active ui-state-persist">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
</body>

</html>
